//轮播图
import { get_banner } from "@/api/banner";
export default {
  namespaced: true,
  state: {
    page: 1,
    limit: 10,
    rows: [],
    total: "",
  },
  mutations: {
    toggle: (state, payload) => {
      state.total = payload.total;
      state.rows = payload.rows;
    },
  },
  actions: {
    getBannerList: async ({ commit, state }) => {
      const { page, limit } = state;
      const data = await get_banner({ page, limit });
      console.log(data, "getBannerList");
      commit("toggle", data);
    },
  },
  getters: {},
};
